<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">

     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								游戏ID：<input type="text" name="gameId"/>
							</li>

							<li>
								玩家ID：<input id="playerId" type="text" name="playerId"/>
							</li>

							<li class="select-time">
								<label>创建时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束" name="params[endTime]"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="col-sm-12 select-table">
				<h3>金币统计:<span id="goldCount"></span></h3>
				<a class="btn btn-primary btn-rounded btn-sm" onclick="goldCount();"><i class="fa"></i>&nbsp;统计</a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('jl:gameLog:edit')}]];
        var removeFlag = [[${@permission.hasPermi('jl:gameLog:remove')}]];
        var prefix = ctx + "jl/gameLog";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "玩家游玩日志",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'ID',
					title : 'ID',
					visible: false
				},
				{
					field : 'gameId',
					title : '游戏ID',
					sortable: false
				},
				{
					field : 'playerId',
					title : '玩家ID',
					sortable: false
				},
				{
					field : 'profitGold',
					title : '输赢金币',
					sortable: false
				},
				{
					field : 'useChannel',
					title : '消耗途径',
					sortable: false
				},
				{
					field : 'createTime',
					title : '时间',
					sortable: true
				}
				/*,
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }*/
		        ]
            };
            $.table.init(options);
        });
        function goldCount() {
            var playerId = $("#playerId").val();
            if(playerId == '') {
                $.modal.alertWarning("玩家ID为空!");
            }
            $.get(ctx + "/ql/goldCount", { playerId: playerId },
                function(data){
					if(data == '') {
                        $("#goldCount").text('0');
					} else {
                        $("#goldCount").text(data);
                    }
                });
		}
    </script>
</body>
</html>